using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using NCT.Framework;

namespace VISS.API.Users {

    /// <summary>
    /// Values of user status
    /// </summary>
    public enum EUserStatus : short {
        /// <summary>
        /// This value is not used for store in DB
        /// </summary>
        Unknown = -1,

        /// <summary>
        /// 
        /// </summary>
        NotActived = 0,
        /// <summary>
        /// 
        /// </summary>
        Actived = 1,
        /// <summary>
        /// 
        /// </summary>
        Disabled = 2,
        /// <summary>
        /// 
        /// </summary>
        Deleted = 4,
        /// <summary>
        /// This status is only set by Admin and its value is embed with others value
        /// </summary>
        Verified = 8,
        /// <summary>
        /// This status is only set by user and its value is embed with others value
        /// </summary>
        Hidden = 16,
        /// <summary>
        /// This value is a special value for Administrator
        /// </summary>
        Admin = 512
    }

    /// <summary>
    /// Values of user login result
    /// </summary>
    public enum EUserLoginResult : short {
        /// <summary>
        /// 
        /// </summary>
        Success = 1,
        /// <summary>
        /// 
        /// </summary>
        WrongEmail = 2,
        /// <summary>
        /// 
        /// </summary>
        WrongPassword = 3,
        /// <summary>
        /// 
        /// </summary>
        NotActived = 4,
        /// <summary>
        /// 
        /// </summary>
        Disabled = 5,
        /// <summary>
        /// 
        /// </summary>
        Deleted = 6,
        /// <summary>
        /// This value is used when an error occurred.
        /// </summary>
        Unknown = 7
    }

    /// <summary>
    /// Values of user email check result
    /// </summary>
    public enum ECheckEmailResult {
        /// <summary>
        /// This value is used when an error occurred.
        /// </summary>
        Unknown = 0,
        /// <summary>
        /// 
        /// </summary>
        Exist = 1,
        /// <summary>
        /// 
        /// </summary>
        NotExist = 2
    }

    /// <summary>
    /// Contains user basic info
    /// </summary>
    [Serializable]
	public class UserEnt {

		#region Properties

        /// <summary>
        /// Gets or sets the user key.
        /// </summary>
        /// <value>The user key.</value>
		public string UserKey { get; set; }
        /// <summary>
        /// Gets or sets the ID.
        /// </summary>
        /// <value>The ID.</value>
		public long ID { get; set; }
        /// <summary>
        /// Gets or sets the email.
        /// </summary>
        /// <value>The email.</value>
		public string Email { get; set; }
        /// <summary>
        /// Gets or sets the password.
        /// </summary>
        /// <value>The password.</value>
		public string Password { get; set; }
        /// <summary>
        /// Gets or sets the status.
        /// </summary>
        /// <value>The status.</value>
		public EUserStatus Status { get; set; }
        /// <summary>
        /// Gets or sets the short link.
        /// </summary>
        /// <value>The short link.</value>
		public string SLink { get; set; }
        /// <summary>
        /// Gets or sets the short link expired date.
        /// </summary>
        /// <value>The short link expired date.</value>
		public DateTime SLinkExpiredDate { get; set; }
        /// <summary>
        /// Gets or sets the date created.
        /// </summary>
        /// <value>The date created.</value>
		public DateTime DateCreated { get; set; }
        /// <summary>
        /// Gets or sets the last login.
        /// </summary>
        /// <value>The last login.</value>
		public DateTime LastLogin { get; set; }
        /// <summary>
        /// Gets or sets the date activated.
        /// </summary>
        /// <value>The date activated.</value>
		public DateTime DateActivated { get; set; }
        /// <summary>
        /// Gets or sets the date modified.
        /// </summary>
        /// <value>The date modified.</value>
		public DateTime DateModified { get; set; }

		#endregion

		#region Constructors

        /// <summary>
        /// Initializes a new instance of the <see cref="UserEnt"/> class.
        /// </summary>
		public UserEnt() {
			UserKey = string.Empty;
			ID = 0;
			Email = string.Empty;
			Password = string.Empty;
			Status = EUserStatus.NotActived;
			SLink = string.Empty;
			SLinkExpiredDate = DateTimeUtils.MinValue;
			DateCreated = DateTimeUtils.MinValue;
			LastLogin = DateTimeUtils.MinValue;
			DateActivated = DateTimeUtils.MinValue;
			DateModified = DateTimeUtils.MinValue;
		}

		#endregion
	}
}